import http from '../util/request.js'

export default {
    add:(obj)=>{
        return http({
            url:'/api/itinerary',
            method:'post',
            data:obj,
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        });
    },
    edit:(obj)=>{
        return http({
            url:'/api/itinerary',
            method:'put',
            data:obj,
            headers: {
                //定义将数据以json的形式传入后台(java)
                'Content-Type': 'application/json'
            }
        });
    },
    del:(id)=>{
        return http({
            url:'/api/itinerary/'+id,
            method:'delete',
        });
    },
    page:(obj)=>{
        return http({
            url:'/api/itinerary/page',
            method:'get',
            params:obj
        });
    },
    pageWithDetails:(obj)=>{
        return http({
            url:'/api/itinerary/pageWithDetails',
            method:'get',
            params:obj
        });
    },
    getDetails:(id)=>{
        return http({
            url:'/api/itinerary/getDetails/'+id,
            method:'get'
        });
    }, generate:(obj)=>{
        return http({
            url:'/api/itinerary/generate',
            method:'post',
            data:obj,
            props:{},
            headers: {
                'Content-Type': 'application/json'
            }
        });}

}